import axios from "./request"

///登录接口
export const login = (params) => {
    return axios({
        url: "/login",
        method: "post",
        data: params
    })
}

///左侧菜单权限
export const getMenus = () => {
    return axios({
        url: "/menus",
        method: "get",
        data: {}
    })
}

///用户数据列表
export const getUsers = (params) => {
    return axios.get('/users',{params:params})
}

///修改用户状态
export const updateUserState = (id,type) => {
    return axios.put(`/users/${id}/state/${type}`)
}

///添加用户
export const addUser = (params) => {
    return axios({
        url: "/users",
        method: "post",
        data: params
    })
}
///根据用户Id获取用户信息
export const getUserInfo = (id) => {
    return axios({
        url: "/users/"+id,
        method: "get",
        data: {}
    })
}
///编辑用户I信息
export const updateUserInfo = (id,email,mobile) => {
    return axios({
        url: "/users/"+id,
        method: "put",
        data: {
            email:email,
            mobile:mobile
        }
    })
}
///删除用户I信息
export const deleteUser = (id) => {
    return axios({
        url: "/users/"+id,
        method: "delete",
        data: {}
    })
}


